package ru.hh.school.commands;

import ru.hh.school.User;
import ru.hh.school.logging.Logger;

import static ru.hh.school.util.ResourceManager.message;

public class SendCommand extends Command {
    public SendCommand(Logger logger) {
        super(logger);
    }

    public String getCommand() {
        return "/send";
    }

    public String getDescription() {
        return message("command.send.description");
    }

    public void process(User user, String userMessage) {
        if (userMessage.equals("")) {
            return;
        }
        String msg = message("command.send.notify.user.send.message.to.room", user.getRoom().getName(), user.getLogin(), userMessage);
        user.getRoom().send(msg);
    }
}